package com.yungu.swift.system.marketing.dao;


import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import com.yungu.swift.base.mapper.IMapper;
import com.yungu.swift.system.marketing.model.dto.MarketingGiftDto;
import com.yungu.swift.system.marketing.model.vo.AdminMarketingGiftVo;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Map;

/**
 * 优惠券礼包Mapper
 * 重写get方法
 *
 * @author xiuyin.cui - Generate
 * @version 1.1.0-SNAPSHOT
 * @since 2019-04-25 13:50
 */
public interface MarketingGiftMapper extends IMapper<MarketingGiftDto> {
    /**
     * shutDownAllByType
     *
     * @param type    Integer
     * @param subType Integer
     * @return int
     */
    int shutdownAllByType(@Param("type") Integer type, @Param("subType") Integer subType);

    /**
     * 详情
     *
     * @param uuid String
     * @return MarketingGiftDto
     */
    AdminMarketingGiftVo detail(String uuid);

    /**
     * getAwardAmount
     *
     * @param subType Integer
     * @return BigDecimal
     */
    BigDecimal getAwardAmount(@Param("subType") Integer subType);

    /**
     * isUpperLimit
     *
     * @param giftUuid      String
     * @param passengerUuid String
     * @return boolean
     */
    boolean isUpperLimit(@Param("giftUuid") String giftUuid, @Param("passengerUuid") String passengerUuid);

    /**
     * isAddRegisterGift
     *
     * @param cityUuid String
     * @return Integer
     */
    Integer isAddRegisterGift(@Param("cityUuid") String cityUuid);

    /**
     * 根据传入参数获取一个礼包
     *
     * @param marketingGiftDto MarketingGiftDto
     * @return MarketingGiftDto
     */
    MarketingGiftDto getInfoByDto(MarketingGiftDto marketingGiftDto);

    MarketingGiftDto findCityByType(@Param("marketingType") Integer marketingType);

    MarketingGiftDto findGiftByMap(Map<String, Object> map);

    Boolean isOpenCity(@Param("areaUuid") String areaUuid, @Param("type") Integer type);

    /**
     * 一次性礼包分页查询
     *
     * @param paramMap
     * @param pageBounds
     * @return
     */
    PageList<MarketingGiftDto> historyGiftQueryPage(Map<String, Object> paramMap, PageBounds pageBounds);
}